//
//  AddDiZhiViewController.m
//  GuoBang
//
//  Created by fengshuai on 16/4/28.
//  Copyright © 2016年 梧桐树. All rights reserved.
//

#import "AddDiZhiViewController.h"

@interface AddDiZhiViewController ()<UITextFieldDelegate>

@end

@implementation AddDiZhiViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupNVA];
    [self setupUI];
    [self setupData];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

- (void)setupNVA
{
    self.title=@"添加地址";
    //设置返回按键
    //返回按键颜色
    [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
    //返回按键图标
    [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60)
                                                         forBarMetrics:UIBarMetricsDefault];
}

- (void)leftAction:(UIBarButtonItem *)sender
{
    [self.navigationController popToRootViewControllerAnimated:YES];
}

- (void)setupData
{

    
    
}

- (void)setupUI
{
    self.view.backgroundColor = RGBCOLOR(245, 245, 245);
    self.baocunBtn.layer.cornerRadius = 5;
    self.baocunBtn.layer.masksToBounds = YES;
    [self.baocunBtn addTarget:self action:@selector(baocunAction:) forControlEvents:UIControlEventTouchUpInside];
    
    self.nameTF.delegate = self;
    self.phoneTF.delegate = self;
    self.shengTF.delegate = self;
    self.detailsAddTF.delegate = self;
    
    
    
    
}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.view endEditing:YES];
}

-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}





- (void)baocunAction:(UIButton *)sender
{
    
    NSLog(@"我是保存");
    
    [self.delegate sendBack];
    
    [self.navigationController popViewControllerAnimated:YES];
    
}



@end
